package com.stp.kafka.config.registry;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ConditionalKafkaListenerEndpointRegistryConfig {

    @Value("${spring.kafka.listener.autostart:true}")
    public boolean autostart;

    @Bean(value = "org.springframework.kafka.config.internalKafkaListenerEndpointRegistry")
    public ConditionalKafkaListenerEndpointRegistry kafkaListenerEndpointRegistry() {
        return new ConditionalKafkaListenerEndpointRegistry(autostart);
    }

}
